import request from '@/utils/request'

// 发布试卷
export function changePaperStatus(id, startTime, isPublished) {
    const data = {
        id,
        startTime,
        isPublished
    }
    return request({
        url: '/exam/paper/publishedPaper',
        method: 'put',
        data: data
    })
}

/**
 * 后台校验开始时间
 * @param id
 * @returns {*}
 */
export function checkStatus(id) {
    return request({
        url: '/exam/paper/checkStatus/' + id,
        method: 'get',
    })
}


// 查询试卷管理列表
export function listPaper(query) {
    return request({
        url: '/exam/paper/list',
        method: 'get',
        params: query
    })
}

// 查询试卷管理详细
export function getPaper(id) {
    return request({
        url: '/exam/paper/' + id,
        method: 'get'
    })
}

// 新增试卷管理
export function addPaper(data) {
    return request({
        url: '/exam/paper',
        method: 'post',
        data: data
    })
}

// 修改试卷管理
export function updatePaper(data) {
    return request({
        url: '/exam/paper',
        method: 'put',
        data: data
    })
}

// 删除试卷管理
export function delPaper(id) {
    return request({
        url: '/exam/paper/' + id,
        method: 'delete'
    })
}
